#!/usr/bin/python

"""calc_profit.py

this script is
"""

__author__ = 'takahiro'
__version__ = '2014-02-10 1.00 (takahiro)'

import sys
import optparse

usage = "%prog [options] [filename]"
parser = optparse.OptionParser( usage=usage )
parser.parse_args( )

if len( sys.argv ) == 1:
  stream = sys.stdin
elif len( sys.argv ) == 2:
  stream = open( sys.argv[ 1 ], 'r' )
else:
  parser.print_help( )
  exit( )


sum = 0
win_sum = 0
lose_sum = 0
even_sum = 0
win_max = 0
lose_max = 0
count = 0
win = 0
lose = 0
even = 0


for line in stream:
  value = int(line.rstrip())
  sum += value
  count += 1
  if value > 0:
    win += 1
    win_sum += value
    if value > win_max:
      win_max = value
  elif value < 0:
    lose += 1
    lose_value = value * -1
    lose_sum += lose_value
    if lose_value > lose_max:
      lose_max = lose_value
  else:
    even += 1
    even_sum += value

print '%d(%f)\t%d\t%d(%f)\t%d(%f)\t%d(%f)\t%d\t%d' % (sum, float(win_sum)/lose_sum, count, win, float(win)/count, lose, float(lose)/count, even, float(even)/count, win_max, lose_max)

